<template>
  <div class="forbidden-container">
    <div class="forbidden-content">
      <div class="forbidden-icon">
        <el-icon size="120" color="#f56c6c">
          <Warning />
        </el-icon>
      </div>
      <h1 class="forbidden-title">无权限访问</h1>
      <p class="forbidden-message">
        抱歉，您没有权限访问此页面。请联系管理员获取相应权限。
      </p>
      <div class="forbidden-actions">
        <el-button type="primary" @click="goBack">
          <el-icon><ArrowLeft /></el-icon>
          返回上一页
        </el-button>
        <el-button @click="goHome">
          <el-icon><House /></el-icon>
          返回首页
        </el-button>
      </div>
    </div>
  </div>
</template>

<script setup>
import { Warning, ArrowLeft, House } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'

const router = useRouter()

const goBack = () => {
  if (window.history.length > 1) {
    router.go(-1)
  } else {
    router.push('/')
  }
}

const goHome = () => {
  router.push('/')
}
</script>

<style scoped>
.forbidden-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-background);
}

.forbidden-content {
  text-align: center;
  max-width: 500px;
  padding: 40px;
}

.forbidden-icon {
  margin-bottom: 24px;
}

.forbidden-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.forbidden-message {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.forbidden-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.forbidden-actions .el-button {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .forbidden-content {
    padding: 20px;
  }
  
  .forbidden-title {
    font-size: 24px;
  }
  
  .forbidden-message {
    font-size: 14px;
  }
  
  .forbidden-actions {
    flex-direction: column;
    align-items: center;
  }
}
</style> 